Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2174 Check that InternetGateway exists before returning from creation #6105

Merged
merged 3 commits into from
Apr 13, 2016

Conversation

carlossg
Copy link
Contributor

@carlossg carlossg commented Apr 9, 2016

Fix #2174 some random InvalidInternetGatewayID.NotFound errors, seems to happen during attachment, right after creation

The errors look like

21:28:49 Initializing environment terraform
21:28:52 [vpc] aws_vpc.myvpc: Creating...
21:28:52 [vpc]   cidr_block:                 "" => "10.16.0.0/16"
21:28:52 [vpc]   default_network_acl_id:     "" => "<computed>"
21:28:52 [vpc]   default_security_group_id:  "" => "<computed>"
21:28:52 [vpc]   dhcp_options_id:            "" => "<computed>"
21:28:52 [vpc]   enable_classiclink:         "" => "<computed>"
21:28:52 [vpc]   enable_dns_hostnames:       "" => "1"
21:28:52 [vpc]   enable_dns_support:         "" => "1"
21:28:52 [vpc]   main_route_table_id:        "" => "<computed>"
21:28:52 [vpc]   tags.#:                     "" => "3"
21:28:52 [vpc]   tags.Name:                  "" => "myvpc-testing"
21:28:52 [vpc] aws_vpc.myvpc: Creation complete
21:28:52 [vpc] aws_internet_gateway.myvpc: Creating...
21:28:52 [vpc]   tags.#:                     "0" => "3"
21:28:52 [vpc]   tags.Name:                  "" => "myvpc-testing"
21:28:52 [vpc]   vpc_id:                     "" => "vpc-c7e1f3a3"
21:28:52 [vpc] aws_subnet.myvpc: Creating...
21:28:52 [vpc]   availability_zone:          "" => "<computed>"
21:28:52 [vpc]   cidr_block:                 "" => "10.16.0.0/16"
21:28:52 [vpc]   map_public_ip_on_launch:    "" => "1"
21:28:52 [vpc]   tags.#:                     "" => "3"
21:28:52 [vpc]   tags.Name:                  "" => "myvpc-testing"
21:28:52 [vpc]   vpc_id:                     "" => "vpc-c7e1f3a3"
21:28:52 [vpc] aws_subnet.myvpc: Creation complete
21:28:52 [vpc] Error applying plan:
21:28:52 [vpc] 
21:28:52 [vpc] 1 error(s) occurred:
21:28:52 [vpc] 
21:28:52 
[vpc] * aws_internet_gateway.myvpc: InvalidInternetGatewayID.NotFound: The internetGateway ID 'igw-748d0310' does not exist
21:28:52 [vpc]  status code: 400, request id: 

…ng from creation

Fix some random InvalidInternetGatewayID.NotFound errors
@@ -50,6 +50,27 @@ func resourceAwsInternetGatewayCreate(d *schema.ResourceData, meta interface{})
return err
}

resource.Retry(5*time.Minute, func() *resource.RetryError {
_, err := conn.DescribeInternetGateways(&ec2.DescribeInternetGatewaysInput{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response here should be able to tell us something useful about the newly created Internet Gateway, I'm not sure we should ignore it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just copied it from https://github.com/hashicorp/terraform/blob/master/builtin/providers/aws/resource_aws_api_gateway_resource.go#L132
Not sure it is useful, other than waiting for consistency in AWS

@catsby
Copy link
Contributor

catsby commented Apr 11, 2016

Hey @carlossg thanks for the PR. Do you think we could re-use the IGStateRefreshFunc method for this?

@catsby catsby added the waiting-response An issue/pull request is waiting for a response from the community label Apr 11, 2016
@carlossg
Copy link
Contributor Author

@catsby something like that ?

@catsby
Copy link
Contributor

catsby commented Apr 13, 2016

LGTM, and the acceptance tests pass, thanks!

@catsby catsby merged commit 32bd25d into hashicorp:master Apr 13, 2016
chrislovecnm pushed a commit to chrislovecnm/terraform that referenced this pull request Apr 16, 2016
…ng from creation (hashicorp#6105)

* Issue hashicorp#2174 Check that InternetGateway exists before returning from creation

Fix some random InvalidInternetGatewayID.NotFound errors

* Issue hashicorp#2174 Reuse IGStateRefreshFunc

* Issue hashicorp#2174 Need to wait for creation before setting tags
@carlossg carlossg deleted the issue-2174 branch May 18, 2016 14:49
@ghost
Copy link

ghost commented Apr 25, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

provider/aws: IGW sometimes takes time to create
3 participants